<html>
<head>
  <title>Evernote Export</title>
  <basefont face="微软雅黑" size="2" />
  <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
  <meta name="exporter-version" content="Evernote Windows/303502 (zh-CN, DDL); Windows/6.3.9600 (Win64);"/>
  <style>
    body, td {
      font-family: 微软雅黑;
      font-size: 10pt;
    }
  </style>
</head>
<body>
<a name="401"/>

<div>
<span><div><span style="font-size: 19px;"><b>Windows下安装</b></span></div><div><span style="color: rgb(51, 51, 51); font-family: &quot;Microsoft Yahei&quot;, 微软雅黑, arial, 宋体, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(255, 255, 255);">     MySQL安装文件分为两种，一种是msi格式的，一种是zip格式的。如果是msi格式的可以直接点击安装，按照它给出的安装提示进行安装（相信大家的英文可以看懂英文提示），一般MySQL将会安装在C:\Program Files\MySQL\MySQL Server 5.6 该目录中；zip格式是自己解压，解压缩之后其实MySQL就可以使用了，但是要进行配置。</span></div><ol><li><span style="font-size: 16px;">msi安装</span></li><li><span style="font-size: 16px;">zip安装</span></li></ol><ul><li><span style="color: rgb(51, 51, 51); font-family: &quot;Microsoft Yahei&quot;, 微软雅黑, arial, 宋体, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(255, 255, 255);"><span style="color: rgb(222, 87, 0);">解压</span>之后可以将该文件夹改名，放到合适的位置</span></li><li><span style="color: rgb(51, 51, 51); font-family: &quot;Microsoft Yahei&quot;, 微软雅黑, arial, 宋体, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(255, 255, 255);"><span style="color: rgb(222, 87, 0);">设置环境变量PATH</span>,在其后面添加: 你的mysql bin文件夹的路径 (如:C:\Program Files\MySQL\MySQL Server 5.6\bin )</span></li><li><div style="margin: 0px; padding: 0px; color: rgb(51, 51, 51); font-family: 'Microsoft Yahei', 微软雅黑, arial, 宋体, sans-serif; font-style: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); font-size: 16px;"><span style="color: rgb(222, 87, 0);">修改配置文件</span>（根目录下my-default.ini）： </div><p style="margin: 0px; padding: 0px; color: rgb(51, 51, 51); font-family: &quot;Microsoft Yahei&quot;, 微软雅黑, arial, 宋体, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);">[mysqld] </p><p style="margin: 0px; padding: 0px; color: rgb(51, 51, 51); font-family: &quot;Microsoft Yahei&quot;, 微软雅黑, arial, 宋体, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);">basedir=C:\Program Files\MySQL\MySQL Server 5.6（mysql所在目录） </p><div style="margin: 0px; padding: 0px; color: rgb(51, 51, 51); font-family: 'Microsoft Yahei', 微软雅黑, arial, 宋体, sans-serif; font-style: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); font-size: 16px;">datadir=C:\Program Files\MySQL\MySQL Server 5.6\data （mysql所在目录\data）</div></li><li><span style="color: rgb(51, 51, 51); font-family: &quot;Microsoft Yahei&quot;, 微软雅黑, arial, 宋体, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(255, 255, 255);">以<span style="color: rgb(222, 87, 0);">管理员身份运行cmd</span>，进入mysql的bin文件夹，输入命令：</span> <span style="color: rgb(222, 87, 0);"><span style="font-family: 'Microsoft Yahei', 微软雅黑, arial, 宋体, sans-serif; font-size: 16px; font-style: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(255, 255, 255);">mysqld -install</span></span></li><li><span style="font-family: 'Microsoft Yahei', 微软雅黑, arial, 宋体, sans-serif; font-size: 16px; font-style: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(255, 255, 255);"><span style="color: rgb(51, 51, 51);">安装成功后就要启动服务了，继续在cmd中输入</span>:<span style="color: rgb(222, 87, 0);">net start mysql</span><span style="color: rgb(51, 51, 51);">，服务启动成功！</span></span></li></ul><div><span style="font-size: 16px;"><span style="font-family: 'Microsoft Yahei', 微软雅黑, arial, 宋体, sans-serif;"><span style="background-color: rgb(255, 255, 255);"><span style="color: rgb(51, 51, 51);"><br/></span></span></span></span></div><div><span style="font-size: 16px;"><span style="font-family: 'Microsoft Yahei', 微软雅黑, arial, 宋体, sans-serif;"><span style="background-color: rgb(255, 255, 255);"><span style="color: rgb(51, 51, 51);"><br/></span></span></span></span></div><div><hr/></div><div><span style="font-size: 16px;"><span style="font-family: 'Microsoft Yahei', 微软雅黑, arial, 宋体, sans-serif;"><span style="background-color: rgb(255, 255, 255);"><span style="color: rgb(51, 51, 51);"><br/></span></span></span></span></div><div><span style="font-size: 19px;"><span style="background-color: rgb(255, 250, 165);-evernote-highlight:true;"><b>设置root密码</b>：</span></span></div><div><span style="font-size: 19px;"><span style="background-color: rgb(255, 250, 165);-evernote-highlight:true;">     <span style="font-size: 16px;">mysqladmin -u root -p password 123456</span></span></span></div><div><span style="font-size: 16px;"><span style="background-color: rgb(255, 250, 165);-evernote-highlight:true;"><br/></span></span></div><div><span style="font-size: 16px;"><span style="background-color: rgb(255, 250, 165);-evernote-highlight:true;"><br/></span></span></div><div><br/></div><div><hr/></div><div><span style="font-size: 19px;"><b>设置mysql编码：</b></span></div><ol><li>查看mysql数据库编码：   <span style="font-size: 16px;">mysql&gt; SHOW VARIABLES LIKE 'character_set_%';</span></li><li>设置编码:  set character_set_<span style="background-color: rgb(255, 250, 165);-evernote-highlight:true;">connection</span> = utf8;</li></ol><div>                          set character_set_server = utf8;</div><div>                          set character_set_client = utf8;</div><div>                          set character_set_database = utf8;</div><div>                          set character_set_results = utf8;</div><div>     <span style="background-color: rgb(255, 250, 165);-evernote-highlight:true;"><b>Linux:</b></span></div><ol><li>关闭mysql服务：service mysql stop</li><li>修改 /etc/mysql/my.cnf    添加：character_set_server=utf8       和   init_connect='SET NAMES utf8'</li><li>重启mysql服务：service mysql start</li></ol><div><br/></div><div><hr/></div><div><br/></div><div><span style="font-size: 19px;"><b>授权远程访问</b></span></div><div> mysql&gt; <span style="color: rgb(222, 87, 0);">GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;</span></div><div>Query OK, 0 rows affected (0.00 sec)</div><div> </div><div>mysql&gt; <span style="color: rgb(222, 87, 0);">flush privileges;</span></div><div>Query OK, 0 rows affected (0.00 sec)    </div><div><br/></div><div><br/></div><div><br/></div><div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);">Can’t connect to MySQL server on ‘192.168.10.18′ (10061)</div><p style="margin: 0px; padding: 0px; color: rgb(0, 0, 0); font-family: Arial; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);">看到这里的MYSQL 10061错误了吗?是因为，mysql的默认配置为了增强安全性，禁止了非本机的访问，在ubuntu中是这样，debian中也是。禁止的方式以前是在my.cnf中有一句</p><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);">skip-network</div><p style="margin: 0px; padding: 0px; color: rgb(0, 0, 0); font-family: Arial; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);">现在则变成了：</p><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);"># Instead of skip-networking the default is now to listen only on # localhost which is more compatible and is not less secure. bind-address = 127.0.0.1</div><p style="margin: 0px; padding: 0px; color: rgb(0, 0, 0); font-family: Arial; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);">就是只监听本机地址。所以，如果要开放局域网内的访问，需要注释掉这一句，或者改成：</p><p style="margin: 0px; padding: 0px; color: rgb(0, 0, 0); font-family: Arial; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);">bind-address = 0.0.0.0</p><div style="margin: 0px; padding: 0px; color: rgb(0, 0, 0); font-family: Arial; font-style: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); font-size: 14px;"><div>就行了</div></div></div><div><span style="font-size: 16px;">          </span></div><div><span style="font-size: 16px;"><br/></span></div><div><br/></div><div><span style="font-size: 16px;"><br/></span></div><div><span style="font-size: 16px;"><br/></span></div><div><span style="font-size: 16px;"><br/></span></div><div><span style="font-size: 16px;"><span style="background-color: rgb(255, 250, 165);-evernote-highlight:true;"><br/></span></span></div><div><br/></div><div><br/></div><div><br/></div></span>
</div></body></html> 